#include <vector>
using std::vector;
class Solution
{
public:
    int uniquePaths(int m, int n)
    {
        vector<vector<int>> vt(m, vector<int>(n, 0));
        vt[0][0] = 1;
        for (int i = 0; i < m; i++)
        {
            for (int j = 0; j < n; j++)
            {
                if (i == 0 && j == 0)
                    continue;
                int up = (i - 1) >= 0 ? vt[i - 1][j] : 0;
                int left = (j - 1) >= 0 ? vt[i][j - 1] : 0;
                vt[i][j] = up + left;
            }
        }
        return vt.back().back();
    }
};